﻿<UserControl
    x:Class="WebSiteAdminTool.UI.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
    xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    mc:Ignorable="d" 
    d:DesignWidth="800" 
    d:DesignHeight="600"
    DataContext="{Binding MainViewModel, Source={StaticResource ViewModelLocator}}">

    <!--<toolkit:Theme Name="theme" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                   ThemeUri="/System.Windows.Controls.Theming.BureauBlue;component/Theme.xaml">-->
    <Grid Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="42" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" MinWidth="50" MaxWidth="300" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <!-- middle layout cell -->
        <sdk:GridSplitter Style="{StaticResource GridSplitterStyle}" 
                              Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" 
                              Name="gridSplitter" />
        <!-- right layout cell -->
        <Border x:Name="ContentBorder" Style="{StaticResource ContentBorderStyle}" 
                Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="2">
            <navigation:Frame Name="mainFrame" JournalOwnership="Automatic" Source="{Binding SelectedPage, Mode=TwoWay}" Style="{StaticResource ContentFrameStyle}" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed">
                <!--<navigation:Frame.UriMapper>
                        <uriMapper:UriMapper>
                            <uriMapper:UriMapping Uri="" MappedUri="/Views/HomePage.xaml"/>
                            //<uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
                        </uriMapper:UriMapper>
                    </navigation:Frame.UriMapper>-->
            </navigation:Frame>
        </Border>
        <!-- top navigation panel -->
        <Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}" 
              Grid.Row="0" Grid.ColumnSpan="3">
            <Border x:Name="BrandingBorder" Style="{StaticResource BrandingBorderStyle}">
                <StackPanel x:Name="BrandingStackPanel" Style="{StaticResource BrandingStackPanelStyle}">
                    <ContentControl Style="{StaticResource LogoIcon}"/>
                    <TextBlock x:Name="ApplicationNameTextBlock" Style="{StaticResource ApplicationNameStyle}" 
                               Text="ASP.Net Web Site Administration Tool"/>
                </StackPanel>
            </Border>
            <Border x:Name="LinksBorder" Style="{StaticResource LinksBorderStyle}">
                <StackPanel Name="LinksStackPanel" Style="{StaticResource LinksStackPanelStyle}">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Command="{Binding Path=NavigationService.NavigateHomeCommand}" Content="Home" />
                    <Rectangle Style="{StaticResource DividerStyle}"/>

                    <HyperlinkButton Style="{StaticResource LinkStyle}" Command="{Binding Path=NavigationService.NavigateToUserManagementCommand}" Content="Security"/>
                    <Rectangle Style="{StaticResource DividerStyle}"/>

                    <HyperlinkButton Style="{StaticResource LinkStyle}" Command="{Binding Path=NavigationService.NavigateHomeCommand}" Content="Application"/>
                    <Rectangle Style="{StaticResource DividerStyle}"/>

                    <HyperlinkButton Style="{StaticResource LinkStyle}" Command="{Binding Path=NavigationService.NavigateToAboutCommand}" Content="About"/>
                </StackPanel>
            </Border>
        </Grid>
        <!-- side panel -->
        <!--<ContentControl x:Name="SidePanelContainer" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">-->
        <toolkit:Accordion Grid.Row="1" BorderBrush="{x:Null}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SelectionMode="OneOrMore" Margin="5" >
            <toolkit:AccordionItem Header="Actions" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <ContentControl x:Name="ActionPanelContainer" Margin="10,10,0,10" VerticalAlignment="Stretch">
                    <!-- Empty by default: content will come in runtime-->
                </ContentControl>
            </toolkit:AccordionItem>
            <!--<toolkit:AccordionItem Header="Empty so far" HorizontalAlignment="Stretch" MaxHeight="150">
                    <StackPanel Margin="10,10,0,10">
                        <CheckBox Content="Arsenal"/>
                        <CheckBox Content="Liverpool"/>
                        <CheckBox Content="Aston Villa"/>
                    </StackPanel>
                </toolkit:AccordionItem>-->
            <toolkit:AccordionItem Header="Status" HorizontalAlignment="Stretch">
                <ContentControl Margin="10,10,0,10" MaxHeight="120">
                    <StackPanel>
                        <CheckBox Content="Sunderland"/>
                        <CheckBox Content="West Ham"/>
                        <CheckBox Content="Blackburn"/>
                    </StackPanel>
                </ContentControl>
            </toolkit:AccordionItem>
        </toolkit:Accordion>
        <!--</ContentControl>-->
    </Grid>
    <!--</toolkit:Theme>-->
</UserControl>